package com.ruoyi.plugs.translation.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.plugs.translation.client.Translator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TranslatorController extends BaseController {

    @Autowired
    Translator translator;

    /**
     *  翻译
     * @param sourceText  原文本
     * @param form  原语言
     * @param to   目标翻译
     * @param type  1:tencent，2:讯飞，3:百度，4:有道,5:阿里云
     * @return
     */
    @GetMapping("/translate")
    @ResponseBody
    public String Translate(String sourceText, String form, String to, Integer type){
        return  translator.Translate(sourceText,form,to,type);
    }

    /**
     * 语种识别
     */
    @GetMapping("/GetDetectLanguage")
    @ResponseBody
    public String GetDetectLanguage(String sourceText){
        return  "";
    }



}
